//
//  ToolUnit.h
//  WeiXiao
//
//  Created by chenxiaojuan on 12-6-29.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//
//  系统名称：ToolUnit 
//  功能描述：通用工具类
//  修改记录：
//       chenxiaojuan   2012-06-29  创建该单元
//       chenxiaojuan   2012-07-23  增加等待框接口
//

#import <Foundation/Foundation.h>
#import "MBProgressHUD.h"

@interface ToolUnit : NSObject<MBProgressHUDDelegate>{
    MBProgressHUD *_HUD;
    MBProgressHUD *_HUDCustom;
}

@property (nonatomic, readonly) MBProgressHUD *HUD;
@property (nonatomic, readonly) MBProgressHUD *HUDCustom;  

+ (UIViewController *)loadFromNav:(NSString *)className;
+ (UIViewController *)loadFromVC:(NSString *)className;
+ (UIViewController *)loadFromNib:(NSString *)className;
+ (UIViewController *)loadFromNib:(NSString *)nibName withClass:(NSString *)className;

- (UIViewController*)loadFromNib:(NSString*)className;
- (UIViewController *)loadFromVC:(NSString *)className;
- (UIViewController*)loadTabBar:(NSString*)name;

- (void)showWithCustomView:(NSString *)strTitle;
+ (void)HUDShow:(NSString*)labelText yOffset:(NSString*)yOffset;
+ (void)HUDHide;

//警告框
+ (void)alert:(NSString*)title message:(NSString*)message;

//字体的size
+ (CGSize)sizeOfText:(NSString *)text withFont:(UIFont *)font withWidth:(float) width;

//时间格式-月日
+ (NSString *)monthDayFromTime:(NSString *)time;
//时间格式-HH:mm
+ (NSString *)hourSecondFromTime:(NSString *)time;
//时间格式-yyyy-MM-dd HH:mm:ss
+ (NSString *)stringFromDateLength:(NSDate *)date;
//时间格式-yyyy-MM-dd HH:mm
+ (NSString *)stringFromDate:(NSDate *)date;
//时间格式-yyyy年mm月dd日 上/下午HH:mm
+ (NSString *)yearMonthDayFromDate:(NSDate *)date;
//时间格式-NSDate
+ (NSDate *)dateFromString:(NSString *)time;

//隐藏webview的阴影
+ (void)hiddenWebviewShaw:(UIWebView*)webview;
//SYNTHESIZE_SINGLETON_FOR_CLASS_HEADER(ToolUnit);

//设置是否清除缓存的标志位
+ (void)setIsClearTableCatchData:(BOOL)blClear;
//设置是否清除缓存的标志位
+ (BOOL)getIsClearTableCatchData;

+ (BOOL)checkEmpryOrWhitespace:(NSString *)text;
@end
